package leetcode.code1328;

public class Solution {
	public String breakPalindrome(String palindrome) {
		int len = palindrome.length();
		if (len == 1) {
			return "";
		}
		for (int i = 0; i < (len >> 1); i++) {
			if (palindrome.charAt(i) > 'a') {
				return palindrome.replaceFirst(palindrome.charAt(i) + "", "a");
			}
		}
		return palindrome.substring(0, len - 1) + "b";
	}
}
